package com.xja.git.service.impl;

import com.xja.git.entity.BlogUser;
import com.xja.git.mapper.BlogUserMapper;
import com.xja.git.mapper.CategoryMapper;
import com.xja.git.mapper.ConmmentMapper;
import com.xja.git.mapper.EntryMapper;
import com.xja.git.service.BlogUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 作者：罗帅
 * 当前类所在包：com.xja.git.service.impl
 * 创建时间：2022/8/17下午 5:09 星期三
 * 此类简介：
 */
@Service
public class BlogUserServiceImpl implements BlogUserService {
    @Autowired
    private BlogUserMapper blogUserMapper;
    @Autowired
    private CategoryMapper categoryMapper;
    @Autowired
    private ConmmentMapper conmmentMapper;
    @Autowired
    private EntryMapper entryMapper;

    public BlogUserMapper getBlogUserMapper() {
        return blogUserMapper;
    }

    public void setBlogUserMapper(BlogUserMapper blogUserMapper) {
        this.blogUserMapper = blogUserMapper;
    }

    public CategoryMapper getCategoryMapper() {
        return categoryMapper;
    }

    public void setCategoryMapper(CategoryMapper categoryMapper) {
        this.categoryMapper = categoryMapper;
    }

    public ConmmentMapper getConmmentMapper() {
        return conmmentMapper;
    }

    public void setConmmentMapper(ConmmentMapper conmmentMapper) {
        this.conmmentMapper = conmmentMapper;
    }

    public EntryMapper getEntryMapper() {
        return entryMapper;
    }

    public void setEntryMapper(EntryMapper entryMapper) {
        this.entryMapper = entryMapper;
    }
    /**
     * 登录
     * @param userName
     * @return
     */
    @Override
    public BlogUser findByUserName(String userName) {
        return blogUserMapper.selectByUserName(userName);
    }

    /**
     * 注册
     * @param blogUser
     */
    @Override
    public void insertBlogUser(BlogUser blogUser) {
        blogUserMapper.insertSelective(blogUser);
    }
}
